package edu.ustb.efws.pipeline.domain;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.util.Date;
import java.util.Objects;

/**
 * 温湿度传感器数据采集
 *
 * @author TS Group
 */
public class Thos {
    @ApiModelProperty("编号")
    private Long id;
    @ApiModelProperty("设备编号")
    private Integer detectorId;
    @ApiModelProperty("氧气浓度")
    private Float o;
    @ApiModelProperty("温度")
    private Float t;
    @ApiModelProperty("湿度")
    private Float h;
    @ApiModelProperty("时间")
    private Date time;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getDetectorId() {
        return detectorId;
    }

    public void setDetectorId(Integer detectorId) {
        this.detectorId = detectorId;
    }

    public Float getO() {
        return o;
    }

    public void setO(Float o) {
        this.o = o;
    }

    public Float getT() {
        return t;
    }

    public void setT(Float t) {
        this.t = t;
    }

    public Float getH() {
        return h;
    }

    public void setH(Float h) {
        this.h = h;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object o1) {
        if (this == o1) return true;
        if (o1 == null || getClass() != o1.getClass()) return false;
        Thos thos = (Thos) o1;
        return Objects.equals(id, thos.id) &&
                Objects.equals(detectorId, thos.detectorId) &&
                Objects.equals(o, thos.o) &&
                Objects.equals(t, thos.t) &&
                Objects.equals(h, thos.h) &&
                Objects.equals(time, thos.time);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, detectorId, o, t, h, time);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("id", id)
                .append("detectorId", detectorId)
                .append("o", o)
                .append("t", t)
                .append("h", h)
                .append("time", time)
                .toString();
    }
}
